package com.code.springbootrabbitmq.exchange;

import com.code.springbootrabbitmq.config.RabbitConfig2;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class Sender {
	
    @Autowired
    private AmqpTemplate rabbitTemplate;
    
    public void send() {
    	System.out.println("发送消息...");
        rabbitTemplate.convertAndSend(RabbitConfig2.QUEUE_NAME, "hello exchange mq");
    }
    
}